#ifndef KERNEL_DEBUG_H
#define KERNEL_DEBUG_H
#include <type.h>

void Debugk(u32 level, char *file, int line, const char *fmt, ...);

#define LOG_LEVEL 0 // 1 DEBUG 2 INFO 3 WARN 4 ERROR
#define LEVEL_D 0
#define LEVEL_I 1
#define LEVEL_W 2
#define LEVEL_E 3

#define LOG(level, fmt, args...)\
    {\
        if ((level) >= (LOG_LEVEL)) {\
            Debugk((level), __BASE_FILE__, __LINE__, (fmt), ##args);\
        }\
    }
#define LOG_DEBUGK(fmt, args...) LOG(LEVEL_D, (fmt), ##args)
#define LOG_INFOK(fmt, args...) LOG(LEVEL_I, (fmt), ##args)
#define LOG_WARNK(fmt, args...) LOG(LEVEL_W, (fmt), ##args)
#define LOG_ERRORK(fmt, args...) LOG(LEVEL_E, (fmt), ##args)

#endif